Beginning Windows Phone App Development by Henry Lee & Eugene Chuvyrov
Author:Henry Lee & Eugene Chuvyrov
Language: eng
Format: epub
Publisher: Apress®
Published: 2011-03-10T16:00:00+00:00
Using Culture Settings with ToString to Display Dates, Times, and Text
To see how you can go about preparing an application for the world, you'll build a simple application that announces a new product—in this case the latest release of Windows Phone. But first you will learn how to use the CultureInfo class to ensure that dates, numbers, and text appear in the right form regardless of the culture in which the announcement is made. Then you'll see how, by using resource (.resx) files, you can easily add translated content to your app to reach new markets.
Let's jump into the code that will set the stage for discussing internationalization of Windows Phone applications.
Start by creating a new project inside Visual Studio and naming it InternationalizationSample. By default, the MainPage.xaml file is created in the development environment, with the designer and XAML windows open and ready to program.
Double-click MainPage.xaml to bring up the XAML designer window. For convenience and simplicity, you will alter the content of the TextBlocks in the TitleGrid block. Make the XAML of TitleGrid look identical to the XAML here: <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12">
<TextBlock x:Name="ApplicationTitle" Text="Current Culture Setting" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="culture" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
Your project should now look like Figure 12-1. So far you've simply changed the text of the default title TextBlock in the Windows Phone application.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(20975)
Hello! Python by Anthony Briggs(20254)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(18618)
Dependency Injection in .NET by Mark Seemann(18409)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(17931)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(17691)
Kotlin in Action by Dmitry Jemerov(17589)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(16942)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(16509)
Grails in Action by Glen Smith Peter Ledbrook(15654)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(13464)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(11541)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10582)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(10485)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(9519)
Hit Refresh by Satya Nadella(9091)
The Kubernetes Operator Framework Book by Michael Dame(8528)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8351)
Robo-Advisor with Python by Aki Ranin(8297)